using Pinwheel.LSerialize;

namespace Pinwheel.Kernel
{
    [LSerializable]
    public partial struct ServiceMessage
    {
        [LSerializeInclude] private MessageType m_Type;
        [LSerializeIgnore] public MessageType Type => m_Type;
        
        [LSerializeInclude] private int m_Session;
        [LSerializeIgnore] public int Session => m_Session;
        
        [LSerializeInclude] private PID m_Source;
        [LSerializeIgnore] public PID Source => m_Source;

        [LSerializeInclude] private PID m_Destination;
        [LSerializeIgnore] public PID Destination => m_Destination;
        
        [LSerializeInclude] private string m_Method;
        [LSerializeIgnore] public string Method => m_Method;
        
        [LSerializeInclude] private IMessage m_Message;
        [LSerializeIgnore] public IMessage Message => m_Message;
        
        
        public void SetType(MessageType type)
        {
            m_Type = type;
        }
        
        public void SetSession(int session)
        {
            m_Session = session;
        }
        
        public void SetRoute(PID source, PID destination)
        {
            m_Source = source;
            m_Destination = destination;
        }
        
        public void SetMethod(string method)
        {
            m_Method = method;
        }
        
        public void SetMessage(IMessage message)
        {
            m_Message = message;
        }
    }
}